<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script>
</head>

<body>
<script type="text/javascript">
var json={
    "status": "200",
    "data": [
        {
            "id": 4,
            "creator": "1",
            "createDate": 1482484873486,
            "lastModifier": "1",
            "lastModDate": 1482484873486,
            "status": 10,
            "creatorName": null,
            "lastModifierName": null,
            "userPaperId": 1,
            "seq": 4,
            "isNew": 1,
            "itecherDirect": null,
            "url": "/word/1482484870971.doc",
            "name": "接口文档.doc",
            "createDateAsDate": 1482484873486,
            "lastModDateAsDate": 1482484873486
        },
        {
            "id": 3,
            "creator": "1",
            "createDate": 1482482197806,
            "lastModifier": "1",
            "lastModDate": 1482484873481,
            "status": 10,
            "creatorName": null,
            "lastModifierName": null,
            "userPaperId": 1,
            "seq": 3,
            "isNew": 0,
            "itecherDirect": null,
            "url": "/word/1482482196658.doc",
            "name": "接口说明文档_all _2_.doc",
            "createDateAsDate": 1482482197806,
            "lastModDateAsDate": 1482484873481
        },
        {
            "id": 2,
            "creator": "1",
            "createDate": 1482481423696,
            "lastModifier": "1",
            "lastModDate": 1482482197799,
            "status": 10,
            "creatorName": null,
            "lastModifierName": null,
            "userPaperId": 1,
            "seq": 2,
            "isNew": 0,
            "itecherDirect": null,
            "url": "/word/1482481412844.docx",
            "name": "毕业答辩系统.docx",
            "createDateAsDate": 1482481423696,
            "lastModDateAsDate": 1482482197799
        },
        {
            "id": 1,
            "creator": "1",
            "createDate": 1482481294144,
            "lastModifier": "1",
            "lastModDate": 1482481423689,
            "status": 10,
            "creatorName": null,
            "lastModifierName": null,
            "userPaperId": 1,
            "seq": 1,
            "isNew": 0,
            "itecherDirect": null,
            "url": "/word/1482481291832.docx",
            "name": "毕业答辩系统.docx",
            "createDateAsDate": 1482481294144,
            "lastModDateAsDate": 1482481423689
        }
    ]
}
var xianshi=eval(json);
/*alert(xianshi.data[0].id)*/
/*var rowCount=xianshi.data.length;*/
function CreateTable()
  { 
     var table=$("<table border=\"1\">");
     table.appendTo($("#createtable"));
    for(var i=0;i<xianshi.data.length;i++)
     {
		
        var tr=$("<tr></tr>");
        tr.appendTo(table);
			/*var tr=$("<tr></tr>");
        	tr.appendTo(table);*/
			for(key in xianshi.data[i]){
					var td=$("<td>"+key+":"+xianshi.data[i][key]+"</td>");
					td.appendTo(tr);
				}
			
        
     }
     
     $("#createtable").append("</table>");
  }
 /* function chuanshu(){
	  	for(i=0;i<xianshi.data.length;i++){
			for(key in xianshi.data[i]){
					alert(key+":"+xianshi.data[i][key])
				}
			}
	  }
	/* chuanshu();*/
</script>

<input type="button" value="添加表格" onClick="CreateTable(4,0)">
<input type="button" value="添加行">
<div id="createtable"></div>
<div id="createrow"></div>
</body>
</html>
